package part1;

public abstract class OrganizationComponent {
    private String name; // 名字
    private String description; // 描述

    protected void add(OrganizationComponent organizationComponent) {
        // 默认实现
        // 为什么需要默认实现？因为叶子节点不需要去重写它。
        throw new UnsupportedOperationException();
    }

    protected void remove(OrganizationComponent organizationComponent) {
        // 默认实现
        // 为什么需要默认实现？因为叶子节点不需要去重写它。
        throw new UnsupportedOperationException();
    }

    public OrganizationComponent(String name, String description) {
        this.name = name;
        this.description = description;
    }

    public String getName() {
        return name;
    }

    public void setName(String name) {
        this.name = name;
    }

    public String getDescription() {
        return description;
    }

    public void setDescription(String description) {
        this.description = description;
    }

    public abstract void print();
}
